#include "mainwindow.h"
#include <QApplication>
#include <QDesktopWidget>
#include <QScreen>

int main(int argc, char *argv[])
{

    QApplication a(argc, argv);

    MainWindow w;
    w.show();
    return a.exec();
}

//#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
//#include <iostream>
//#include <CGAL/Simple_cartesian.h>
//
//typedef CGAL::Simple_cartesian<double> Kernel;
//typedef Kernel::Point_2 Point_2;
//typedef Kernel::Segment_2 Segment_2;
//
//int main()
//{
    //Point_2 p(1, 1), q(10, 10);

    //std::cout << "p = " << p << std::endl;
    //std::cout << "q = " << q.x() << " " << q.y() << std::endl;

    //std::cout << "sqdist(p,q) = "
    //    << CGAL::squared_distance(p, q) << std::endl;

    //Segment_2 s(p, q);
    //Point_2 m(5, 9);

    //std::cout << "m = " << m << std::endl;
    //std::cout << "sqdist(Segment_2(p,q), m) = "
    //    << CGAL::squared_distance(s, m) << std::endl;

    //std::cout << "p, q, and m ";
    //switch (CGAL::orientation(p, q, m)) {
    //case CGAL::COLLINEAR:
    //    std::cout << "are collinear\n";
    //    break;
    //case CGAL::LEFT_TURN:
    //    std::cout << "make a left turn\n";
    //    break;
    //case CGAL::RIGHT_TURN:
    //    std::cout << "make a right turn\n";
    //    break;
    //}

    //std::cout << " midpoint(p,q) = " << CGAL::midpoint(p, q) << std::endl;
//    return 0;
//}

//#include<nlopt.h>
//#include<nlopt.hpp>
//typedef struct
//{
//    double a, b;
//}my_constraint_data;
//double myconstraint(unsigned n, const double* x, double* grad, void* data)
//{
//    my_constraint_data* d = (my_constraint_data*)data;
//    double a = d->a, b = d->b;
//    if (grad)
//    {
//        grad[0] = 3 * a * (a * x[0] + b) * (a * x[0] + b);
//        grad[1] = -1.0;
//    }
//    return ((a * x[0] + b) * (a * x[0] + b) * (a * x[0] + b) - x[1]);
//}
//int count = 0;
//double myfunc(unsigned n, const double* x, double* grad, void* my_func_data)
//{
//    ++count;
//    if (grad)
//    {
//        grad[0] = 0.0;
//        grad[1] = 0.5 / sqrt(x[1]);
//    }
//    return sqrt(x[1]);
//}
//int main()
//{
//    double lb[2] = { -HUGE_VAL, 0 };
//    nlopt_opt opt;
//    opt = nlopt_create(NLOPT_LD_MMA, 2);
//    nlopt_set_lower_bounds(opt, lb);
//    nlopt_set_min_objective(opt, myfunc, NULL);
//    my_constraint_data data[2] = { { 2, 0 }, { -1, 1 } };
//    nlopt_add_inequality_constraint(opt, myconstraint, &data[0], 1e-8);
//    nlopt_add_inequality_constraint(opt, myconstraint, &data[1], 1e-8);
//    nlopt_set_xtol_rel(opt, 1e-4);
//    double x[2] = { 1.234, 5.678 };
//    double minf;
//    if (nlopt_optimize(opt, x, &minf) < 0)
//    {
//        printf("nlopt faild!\n");
//    }
//    else
//    {
//        printf("found minimum after %d evaluations\n", count);
//        printf("found minimum at f(%g,%g)=&0.10g\n", x[0], x[1], minf);
//    }
//    nlopt_destroy(opt);
//    system("pause");
//    return 0;
//}

//#include <iostream>
//#include <opencv2/opencv.hpp>
//
//int main() {
//    std::cout << "OpenCV version: " << CV_VERSION << std::endl;
//    return 0;
//}


